package com.example.entity.dto;

import com.example.anno.CheckName;
import com.example.anno.CheckSqlValidate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@EqualsAndHashCode(callSuper = true)
@Data
public class CourseDTO extends ParentDTO{

    @NotNull(message = "id 不能为空!")
    private Long id;

    // @CheckSqlValidate // 自定义 validate 注解
    @CheckName
    private String name;

    @Min(value = 0, message = "年龄不能为负数!")
    private Integer age;

    @NotNull
    @CheckName(checkOrder = true)
    private String order;

}
